package com.lkl.hystrixdemo.order.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class StudentService {

    //@Autowired
    TeacherService teacherService;


    public StudentService() {
        System.out.println("studentService is init...");
    }
    //@Autowired
    public StudentService(TeacherService teacherService) {
        this.teacherService = teacherService;
    }

    @Autowired
    public void setTeacherService(TeacherService teacherService) {
        this.teacherService = teacherService;
    }


    public void learn() {
        teacherService.teach();
        System.out.println("学生正在上课");
    }

    public static void main(String[] args) {

    }
}
